<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模板中的语法</title>
</head>
<body>
<h1>sdfwe</h1>
<div>{{n1}}</div>
<div>{{n2}}</div>
<div>{{n2.0}}</div>
<div>{{n2.1}}</div>
<div>{{n2.2}}</div>

{% for item in n2 %}
    <span>{{ item }}</span>
{% endfor %}
<hr/>
<div>{{ n3 }}</div>
<div>
    <span>姓名：{{ n3.name }}</span>
    <span>职位：{{ n3.roles }}</span>
    <span>生日：{{ n3.birth }}</span>
</div>
<div>
    {% for item in n3 %}
        <span>{{ item }}</span>
    {% endfor %}
</div>
<ul>
    {% for item in n3.values %}

        <li>{{ item }}</li>
    {% endfor %}
</ul>

<ul>
    {% for item in n3.items %}

        <li>{{ item }}</li>
    {% endfor %}
</ul>

<ul>
    {% for k,v in n3.items %}

        <li>{{ k }}:{{ v }}</li>
    {% endfor %}
</ul>
<hr/>
<div>

    {% for dict in n4 %}
        {% for k,v in dict.items %}
            <div>{{ k }}:{{ v }}</div>
        {% endfor %}
    {% endfor %}
</div>

<div>
    <table>
        <thead>
        <tr>
            {% for item in n4.1 %}
                <th>{{ item }}</th>
            {% endfor %}
        </tr>
        </thead>
        <tbody>
        {% for item in n4 %}
            <tr>
                {% for i in item.values %}
                    <td> {{ i }}</td>
                {% endfor %}

            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>

<hr/>
{% if n1 == "朱元璋" %}
    <div>明朝开国皇帝</div>
{% else %}
    <div>不是明朝开国皇帝</div>
{% endif %}
<div>
    {% if n1 == "朱元璋" %}
        <div>明朝开国皇帝</div>
    {% elif n1 == "赵匡胤" %}
        <div>宋朝开国皇帝</div>
    {% elif n1 == "刘邦" %}
        <div>汉朝开国皇帝</div>
    {% else %}
        <div>哪个朝代的开国皇帝呢？</div>
    {% endif %}
</div>

</body>
</html>